#!/bin/bash

if [ ! -f "/proc/sys/fs/binfmt_misc/qemu-riscv64" ]; then
	./qemu-binfmt-conf.sh --qemu-path /usr/bin
fi

if [ $# -lt 1 ]; then
	sudo docker run --rm -v ~/:/mnt -v /usr/bin/qemu-riscv64:/usr/bin/qemu-riscv64 -it ft2team/rv_2404
	exit 0
fi

# sudo docker build -t ft2team/rv_2404 -f rv_2404.df .
sudo docker run --rm -v ~/:/mnt -v /usr/bin/qemu-riscv64:/usr/bin/qemu-riscv64 -it ft2team/rv_2404
